import myAxios from "@/axios/index.js";

// 获取选品入库接口
// /productlist/list
export function getSelectList(page = 1) {
  return myAxios.post("/productlist/list", {
    cp: page,
    kw: "",
    ls: 15,
    producttype: "",
    producttype2: "",
    sign: 0,
  });
}

//获取商品列表接口
// /productlist/list/${current}/${pagesize}
export function getGoodsList(current = 1, pagesize = 10) {
  return myAxios.post(`/productlist/list/${current}/${pagesize}`, {
    endPrice: "",
    monthlySalesMax: "",
    periceLow: "",
    productname: "",
    startPrice: "",
  });
}

//获取分类
// /productclassify/list
export function getGoodsCat() {
  return myAxios.post("/productclassify/list");
}

//商品列表id查询接口
// /productlist/getRowInfo/{id}
export function getGoodsId(id) {
  return myAxios.get(`/productlist/getRowInfo/${id}`);
}

//商品列表根据金额查询接口
// /productlist/list/{current}/{pagesize}
export function getGoodsPrice(startPrice, endPrice,current = 1, pagesize = 10) {
  return myAxios.post(`/productlist/list/${current}/${pagesize}`, {
    endPrice: endPrice,
    monthlySalesMax: "",
    periceLow: "",
    productname: "",
    startPrice: startPrice,
  });
}


//入库接口
// /productlist/update
export function getGoodsInStorage(arr) {
  return myAxios.post(`/productlist/update`, arr);
}
